import React,{useContext} from "react";
import {useNavigate} from 'react-router-dom';
import { GlobalContext } from "../component/GlobalContext";
const Login = () => {
    const context = useContext(GlobalContext);
    
    const navigate = useNavigate();
    const goLogin = () => {
        navigate('/about');
        context.setIsLogin(true);
    };
    return <>
            <div>
                用户名：<input type="text" />
                密码:<input type='password' />
            </div>
            <button onClick={goLogin}>登录</button>
    </>
}

export default Login;